package com.hongyuan.sellfitness.ui.home.view_mode;

import android.os.Bundle;

import androidx.annotation.NonNull;
import androidx.databinding.ObservableField;

import com.hongyuan.mvvmhabitx.binding.command.BindingCommand;
import com.hongyuan.sellfitness.base.ItemViewModel;
import com.hongyuan.sellfitness.ui.home.activity.CardDetailsActivity;
import com.hongyuan.sellfitness.ui.home.activity.StoreListActivity;
import com.hongyuan.sellfitness.ui.home.beans.StoreCardBean;

public class StoreCardItemViewModel extends ItemViewModel<StoreCardViewModel> {

    public ObservableField<StoreCardBean.ListBean> entity = new ObservableField<>();

    public StoreCardItemViewModel(@NonNull StoreCardViewModel viewModel,StoreCardBean.ListBean bean) {
        super(viewModel);
        entity.set(bean);
    }

    //会员卡详情
    public BindingCommand goDetails = new BindingCommand(() -> {
        Bundle bundle = new Bundle();
        bundle.putString("card_id",String.valueOf(entity.get().getCard_id()));
        viewModel.startActivity(CardDetailsActivity.class,bundle);
    });
}
